package com.feng.security.vo;

import com.feng.mbg.domain.SysUser;
import com.feng.security.domain.LoginUser;
import lombok.Data;

import java.util.List;

/**
 * @author Feng
 * @since 2022/4/23 14:51
 */
@Data
public class LoginUserVO {

    private Long userId;

    private String username;

    private String nickName;

    private String avatar;

    private String gender;

    private String phone;

    private String email;

    private Integer roleLevel;

    private List<String> perms;

    public LoginUserVO(LoginUser loginUser) {
        SysUser user = loginUser.getUser();
        this.userId = user.getUserId();
        this.username = user.getUsername();
        this.nickName = user.getNickName();
        this.avatar = user.getAvatar();
        this.roleLevel = loginUser.getLevel();
        this.perms = loginUser.getPermissions();
    }
}
